import request from '@/utils/request'

/**
 * 发送AI聊天消息
 */
export function sendAiMessage(data) {
  return request.post('/ai/chat', data)
}

/**
 * 获取会话列表
 */
export function getConversations() {
  return request.get('/ai/conversations')
}

/**
 * 获取会话消息列表
 */
export function getMessages(conversationId) {
  return request.get(`/ai/conversations/${conversationId}/messages`)
}

/**
 * 创建新会话
 */
export function createConversation(title = '新对话') {
  return request.post('/ai/conversations', null, {
    params: { title }
  })
}

/**
 * 删除会话
 */
export function deleteConversation(conversationId) {
  return request.delete(`/ai/conversations/${conversationId}`)
}

